home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
internet
/
irc_i_dodatki
/
kuang
/
kuangeleven28.lha
/
Rexx
/
Dccdone.amirx
< prev
next >
Wrap
Text File
|
1997-03-28
|
3KB
|
143 lines
/* Kuang Eleven V2.5 Dccdone.amirx*/
options results
parse arg com successcode nick filename
filename=strip(filename,'B',' "')
if successcode then ply('DCC_DONE')
/* AutoMove Sounds */
/**/
if com='RECEIVE' then do
if ~successcode then exit
file=filepart(filename)
patrs=getclip('sc_manpatr')
if patrs~='' then do
pr='Manager'
readargs(patrs,'Pattern/M')
readargs(getclip('sc_manpath'),'Path/M')
do i=0 to pattern.count-1
if matchpattern(pattern.i,file,'NOCASE') then do
move(path.i)
exit
end
end
end
if getclip('sc_amsound')~=='ON'|find('.WAV .SND .VOC',upper(right(file,4)))=0 then exit
pr='MoveSound'
"GETCTCPSOUNDDIR"
move(prsprg(result))
exit
end
/**/
"GETDCC"
/* CPS Record */
/**/
if successcode then do
"GETMYNICK"
"USERHOST" result
myhost=substr(result,pos('@',result)+1)
do i=1 to dcc.send.0
parse value dcc.send.i WITH mnick moveflag hostname state len cps mfilename
mfilename=strip(mfilename,'B',' "')
if hostname~='localhost'&len>100000&mnick=nick&mfilename=filename&state=3 then do
x=getclip('st_maxcps')
if x='' then x=0
if cps>x then do
cecho('MaxCPS',bld('New record') 'acheived from' bld(nick) ':'bld(cps) 'cps!')
setclip('st_maxcps',cps)
end
leave
end
end
end
/**/
/* Queue */
/**/
l=getclip('st_xdccq')
if l='' then exit
s=getclip('sc_xdccslots')
if s='' then s=6
free=s-getslots()
if free<1 then exit
pr='XDCC';lb=l
do until l=''
parse var l q l
parse var q nick'@'spec'@'com'@'files'@'addr .
if files<=free then do
address value 'AMIRC.'addr
if getclip('sc_xdcc')=='ON' then do
"USERHOST" nick
if pos('@',result)=0 then cecho(pr,'Queued request from' bld(nick) 'aborted.')
else amrx('kuang11XDCC 1 queue' com nick spec)
end
else do
notice(nick,'XDCC has been disabled.')
cecho(pr,'Queued request from' bld(nick) 'aborted.')
end
setclip('st_xdccq',strip(delword(lb,find(lb,q),1)))
exit
end
end
/**/
exit
/* #### SHARED FUNCTIONS #### */
/**/
cecho:;"ECHO P="d2c(27)"b«"arg(1)"»" arg(2);return 0
notice:;'RAW NOTICE' arg(1) ':'arg(2);return 0
bld:PROCEDURE;b=x2c('02');return b||arg(1)||b
amrx:;'SAY /RX' arg(1);return 0
prsprg:PROCEDURE
x=arg(1)
z=right(x,1)
if z~='/'&z~=':' then x=x||'/'
if upper(left(x,8))='PROGDIR:' then do
y=pragma('d')
z=right(y,1)
if z~='/'&z~=':' then y=y||'/'
if length(x)>8 then return y||substr(x,9);else return y
end
return x
move:
if ~exists(arg(1)) then do
cecho(pr,arg(1) 'does not exist')
exit
end
dest=absolutepath(arg(1))
filename=absolutepath(filename)
file=filepart(filename)
destfile=addpart(dest,file)
if exists(destfile) then do
cecho(pr,file 'already found in' dest)
exit
end
parse var filename dev1 ':' .
parse var dest dev2 ':' .
dev1=absolutepath(strip(dev1,'L','"')':')
dev2=absolutepath(strip(dev2,'L','"')':')
if dev1=dev2 then rename(filename,destfile)
else address command 'copy "'filename'" "'destfile'"'
if exists(destfile) then do
cecho(pr,file 'moved to' destfile)
delete(filename)
end
else cecho(pr,'Unable to move' filename 'to' dest)
exit
getslots:procedure
l=showlist('W') showlist('T')
x=0;p=1
do until p=0
p=pos('AmIRC DCC S',l,p)
if p~==0 then do
x=x+1;p=p+21
end
end
return x
ply:
if getclip('sc_playsounds')~=='ON' then return 0
'PLAYSOUND _K11'arg(1)'.snd'
return 0
/**/